<#include "/layout/header.ftl" />
<#import "/include/ui.ftl" as blue />

<script>

function delete_click(id)
{
	$.simpleConfirm("确定删除？", function(op)
	{
		$.simpleAjax("/base/auth/menu_auth_delete", {id: id}, function(o)
		{
			$.successAlert("删除成功");
			$("#tr_"+id).remove();
		});
	});
}
</script>

<div class="am-g am-cf am-margin-top am-margin-bottom">
	<div class="am-u-sm-3 am-padding-right-0">
		<div class="am-btn-group">
			<a href="${path}/base/auth/menu_auth_get?menuId=${(parentModel.id)!}" class="am-btn am-btn-primary am-radius">添加</a>
			<a href="${path}/base/auth/menu_list" class="am-btn am-btn-danger am-radius">返回</a>
		</div>
	</div>
	<div class="am-u-sm-9 am-form-inline" id="div_search">
		<span class="am-text-xl">${(parentModel.name)!}－权限列表</span>
	</div>
</div>

<div class="am-g" id="div_grid">
	<div class="am-u-sm-12">
		<table class="am-table am-table-striped am-table-hover">
			<thead>
			<tr>
				<th width="300">名称</th>
				<th >链接</th>
				<th width="100">状态</th>
				<th width="150">操作</th>
			</tr>
			</thead>
			<tbody>
			<#list modelList as vo>
			<tr id="tr_${vo.id}">
				<td title="${vo.name!}">${vo.name!}</td>
				<td title="${vo.url!}">${vo.url!}</td>
				<td>${vo.state!}</td>
				<td>
					<div class="am-btn-group">
						<a href="${path}/base/auth/menu_auth_get?id=${vo.id}&menuId=${vo.menuId}" class="am-btn am-btn-primary am-btn-sm am-radius">编辑</a>
						<a href="javascript:void(0)" onclick="delete_click('${vo.id}')" class="am-btn am-btn-danger am-btn-sm am-radius">删除</a>
					</div>
				</td>
			</tr>
			</#list>
			</tbody>
		</table>
	</div>
</div>

<#include "/layout/footer.ftl" />